//
//  SchoolDetailActivityTableViewCell.swift
//  HoneyBee
//
//  Created by point on 2018/6/2.
//  Copyright © 2018年 point. All rights reserved.
//

import UIKit

class SchoolDetailActivityTableViewCell: UITableViewCell {

    fileprivate lazy var activityLabel =  UILabel.init(UIColor.init(hex: "333333")!, 14, "优惠活动")
    
    fileprivate lazy var giftImg = UIImageView(imgName: "gift")
    
  
    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        selectionStyle = .none
        setupUI()
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

}

// MARK:- 显示数据
extension SchoolDetailActivityTableViewCell {
    func configModel(model:SchoolDetailModel) {
       activityLabel.text = model.preferential
    }
}

extension SchoolDetailActivityTableViewCell {
    fileprivate func setupUI(){
        contentView.addSubview(activityLabel)
         contentView.addSubview(giftImg)
        activityLabel.snp.makeConstraints { (make) in
            make.centerY.equalTo(contentView).jOffset(-2.5)
            make.left.equalTo(contentView).jOffset(30)
        }
        
        let oneLineView = UIView()
        contentView.addSubview(oneLineView)
        oneLineView.backgroundColor = UIColor.init(hex: "eeeded")
        oneLineView.snp.makeConstraints { (make) in
            make.jHeight(5)
            make.left.right.equalTo(contentView)
            make.bottom.equalTo(contentView)
        }
        
        giftImg.snp.makeConstraints { (make) in
            make.size.equalTo(CGSize(width: 16, height: 16))
            make.centerY.equalTo(activityLabel)
            make.left.equalTo(contentView).offset(7.5)
        }
        
    }
}
